KD = window.KD ||{
	writeLoginInfo:function(){
		var uid = $.cookie('uid');
		var uname = $.cookie('uname');
		if(uid && uname){
			document.write(KD.renderLoginInfo(uid,uname));
		} else {
			document.write(KD.renderLoginInfo(uid,uname));
		}
	},
	renderLoginInfo:function(uid,uname){
		if($.cookie('web_name')){
			var webname = $.cookie('web_name');
		}else{
			var webname = '本站';
		}
		if(uid && uname){
			var userinfo = '';
		}else{
			var userinfo = '你好，欢迎来到'+ webname +'！ <a href="'+ U('member/Login/index',["f=top"]) +'">请登录</a> <a href="'+ U('member/Register/index',["f=top"]) +'">免费注册</a>';
		}
		return userinfo;
	}
};
//模拟ts U函数
function U(url,params){
	var website = _ROOT_+'/index.php';
	url = url.split('/');
	if(url[0]=='' || url[0]=='@')
		url[0] = APPNAME;
	if (!url[1])
		url[1] = 'Index';
	if (!url[2])
		url[2] = 'index';
	website = website+'?app='+url[0]+'&mod='+url[1]+'&act='+url[2];
	if(params){
		params = params.join('&');
		website = website + '&' + params;
	}
	return website;
}


